package ac.technion.StreamMania;

import android.graphics.drawable.Drawable;

/** 
 * implements Comparable(IconofiedText) so that the drawables we select are used
 * for the iconofied text, and the iconofied text can be compared by it's name.
 */
public class IconifiedText implements Comparable<IconifiedText>{
	private String mText = "";
	private Drawable mIcon;
	private boolean mSelectable = true;

	public IconifiedText(String text, Drawable bullet) {
		mIcon = bullet;
		mText = text;
	}
	
	public boolean isSelectable() {
		return mSelectable;
	}
	
	public void setSelectable(boolean selectable) {
		mSelectable = selectable;
	}
	
	public String getText() {
		return mText;
	}
	
	public void setText(String text) {
		mText = text;
	}
	
	public void setIcon(Drawable icon) {
		mIcon = icon;
	}
	
	public Drawable getIcon() {
		return mIcon;
	}

	/** Make IconifiedText comparable by its name */
	public int compareTo(IconifiedText other) {
		if(this.mText != null)
			return this.mText.compareTo(other.getText()); 
		else 
			throw new IllegalArgumentException();
	}
}

